﻿//Модель
Ext.define('model.Notification', {
    extend: 'Ext.data.Model',
    fields: [
       { name: 'Notification.ID' },
       { name: 'Notification.NotificationNumber' },
       { name: 'Notification.iPublishDate' },
       { name: 'Notification.OrderName' },
       { name: 'Notification.MaxPrice' },
       { name: 'Notification.PlacingWay.Name' },
       { name: 'Notification' },
       { name: 'Notification.Order.OrderOrganization.FullName' },
       { name: 'Notification.Order.OrderOrganization.FactualAddress.AddressLine' },
       { name: 'Notification.Order.OrderOrganization.FactualAddress.DictionaryFactualAddressRegion.fullName' },
       { name: 'Notification.NotificationCommission.iP2Date' },
       { name: 'DataRows' }
    ],
    idProperty: 'Notification.ID'
});

//Хранилище
Ext.define('Storage.notificationRowsStore', {
    extend: 'Ext.data.Store',
    model: 'model.Notification',
    proxy: new Ext.data.HttpProxy({
        headers: { 'Content-type': 'application/json' },
        reader: { root: 'd' },
        api: { read: '/DefaultPort.ashx/GetNotificationFromDocumentRows' }
    })
});
